package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class UserDefinedTypeBody {

    private int beginIndex;
    private int endIndex;
    private SchemaQualifiedName schemaResolvedUserDefinedTypeName;
    private SubtypeClause subtypeClause;
    private Representation representation;
    private UserDefinedTypeOptionList userDefinedTypeOptionList;
    private MethodSpecificationList methodSpecificationList;

    public UserDefinedTypeBody(SchemaQualifiedName schemaResolvedUserDefinedTypeName,
                               SubtypeClause subtypeClause,
                               Representation representation,
                               UserDefinedTypeOptionList userDefinedTypeOptionList,
                               MethodSpecificationList methodSpecificationList) {
        this.beginIndex = schemaResolvedUserDefinedTypeName.getBeginIndex();
        this.endIndex = schemaResolvedUserDefinedTypeName.getEndIndex();
        if (subtypeClause != null) {
            this.endIndex = subtypeClause.getEndIndex();
        }
        if (representation != null) {
            this.endIndex = representation.getEndIndex();
        }
        if (userDefinedTypeOptionList != null) {
            this.endIndex = userDefinedTypeOptionList.getEndIndex();
        }
        if (methodSpecificationList != null) {
            this.endIndex = methodSpecificationList.getEndIndex();
        }
        this.schemaResolvedUserDefinedTypeName = schemaResolvedUserDefinedTypeName;
        this.subtypeClause = subtypeClause;
        this.representation = representation;
        this.userDefinedTypeOptionList = userDefinedTypeOptionList;
        this.methodSpecificationList = methodSpecificationList;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public SchemaQualifiedName getSchemaResolvedUserDefinedTypeName() {
        return schemaResolvedUserDefinedTypeName;
    }

    public SubtypeClause getSubtypeClause() {
        return subtypeClause;
    }

    public Representation getRepresentation() {
        return representation;
    }

    public UserDefinedTypeOptionList getUserDefinedTypeOptionList() {
        return userDefinedTypeOptionList;
    }

    public MethodSpecificationList getMethodSpecificationList() {
        return methodSpecificationList;
    }

}
